/*
 * Copyright Thoughtworks, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// contains all common "framework" css
@import "variables";
@import "foundation_and_overrides";

// make sure to load after foundation
@import "bourbon/core/bourbon";
@import "keyframes";
@import "font-awesome-glyphs";
@import "global";
@import "fonts";
@import "shared/server_health_messages";

$tooltip-background-color: #333;

.tooltip-question-mark {
  @include icon-after(
    question-circle,
    $size: $form-label-font-size,
    $color: $form-label-color,
    $margin: 0,
    $line-height: $form-label-line-height) {
    margin-left: 10px;
    margin-right: 10px;
  }
}

.tooltip-info {
  @include icon-after(
    info-circle,
    $size: $form-label-font-size,
    $color: $form-label-color,
    $margin: 0,
    $line-height: $form-label-line-height) {
    margin-left: 10px;
    margin-right: 10px;
  }
}

.tooltip-content {
  font-family: $body-font-family;
  cursor: auto;
  font-size: rem-calc(13px);
  text-transform: none;

  * {
    font-size: rem-calc(13px);
  }
}

.f-dropdown {
  > *:only-child {
    > *:first-child {
      margin-top: 0;
    }

    > *:last-child {
      margin-bottom: 0;
    }
  }

  &.tiny {
    width: 200px;
  }

  &.small {
    width: 300px;
  }

  &.medium {
    width: 500px;
  }

  &.large {
    width: 800px;
  }
}

.has-tip {
  border-bottom: transparent;
  display: inline;
}

.tooltip {
  padding: 6px 10px;
  line-height: 15px;
  font-size: 12px;
  background: $tooltip-background-color;

  &::before {
    border-color: transparent transparent $tooltip-background-color;
  }

  &.top::before {
    @include css-triangle($tooltip-pip-width, $tooltip-background-color, down);

    top: 100%;
    bottom: auto;
  }

  &.left::before {
    @include css-triangle($tooltip-pip-width, $tooltip-background-color, right);

    top: 50%;
    bottom: auto;
    left: 100%;
    transform: translateY(-50%);
  }

  &.right::before {
    @include css-triangle($tooltip-pip-width, $tooltip-background-color, left);

    inset: 50% 100% auto auto;
    transform: translateY(-50%);
  }
}
